/*
 * @Description:
 * @Author: CcSimple
 * @Github: https://github.com/CcSimple
 * @Date: 2023-02-09 10:40:26
 * @LastEditors: CcSimple
 * @LastEditTime: 2023-02-09 11:37:21
 */
import { hiprint } from "vue-plugin-hiprint";

export const provider1 = function (options) {
 
  var addElementTypes = function (context) {
    let TableG= new hiprint.PrintElementTypeGroup("表格", config.TriageTableCols)
    context.removePrintElementTypes("providerModule1");
    context.addPrintElementTypes("providerModule1", [
      new hiprint.PrintElementTypeGroup("基础元素", [
        {
          tid: "providerModule1.header",
          title: "单据表头",
          data: "单据表头",
          type: "text",
          options: {
            testData: "单据表头",
            height: 17,
            fontSize: 16.5,
            fontWeight: "700",
            textAlign: "center",
            hideTitle: true,
          },
        },
        {
          tid: "providerModule1.keyvalue",
          title: "键值",
          data: "键值",
          type: "text",
          options: {
            field: "text",
            testData: "数据",
            height: 12,
            fontSize: 10,
            textAlign: "left",
            textContentVerticalAlign: "middle",
          },
        },
        {
          tid: "providerModule1.text",
          title: "文本",
          data: "XS888888888",
          type: "text",
          options: {
            field: "text",
            testData: "XS888888888",
            height: 12,
            fontSize: 9,
            textAlign: "left",
            textContentVerticalAlign: "middle",
            hideTitle: true,
          },
        },
        {
          tid: "providerModule1.sttext",
          title: "加粗文本",
          data: "XS888888888",
          type: "text",
          options: {
            field: "sttext",
            testData: "测试",
            height: 12,
            fontSize: 9,
            fontWeight: "700",
            textAlign: "left",
            textContentVerticalAlign: "middle",
            hideTitle: true,
          },
        },
        {
          tid: "providerModule1.date",
          title: "日期",
          data: "2020-01-01",
          type: "text",
          options: {
            field: "date",
            testData: "2020-01-01",
            height: 16,
            fontSize: 10,
            textAlign: "left",
            textContentVerticalAlign: "middle",
          },
        },
        {
          tid: "providerModule1.barcode",
          title: "条形码",
          data: "XS888888888",
          type: "text",
          options: {
            field: "barcode",
            testData: "XS888888888",
            height: 32,
            fontSize: 12,
            lineHeight: 18,
            textAlign: "left",
            textType: "barcode",
          },
        },
        {
          tid: "providerModule1.qrcode",
          title: "二维码",
          data: "XS888888888",
          type: "text",
          options: {
            field: "qrcode",
            testData: "XS888888888",
            height: 32,
            fontSize: 12,
            lineHeight: 18,
            textType: "qrcode",
          },
        },
        { tid: "providerModule1.image", title: "图片", data: "", type: "image" },
      ]),
      ,
      new hiprint.PrintElementTypeGroup("辅助", [
        {
          tid: "providerModule2.hline",
          title: "横线",
          type: "hline",
        },
        {
          tid: "providerModule2.vline",
          title: "竖线",
          type: "vline",
        },
        {
          tid: "providerModule2.rect",
          title: "矩形",
          type: "rect",
        },
        {
          tid: "providerModule2.oval",
          title: "椭圆",
          type: "oval",
        },
      ]),
      TableG
    ]);
  };
  return {
    addElementTypes: addElementTypes,
  };
};
